]> dgit.raspbian.org Git - qt6-base.git/commit
[PATCH] Revert "QProcessEnvironment: simplify locking"
authorMiao Wang <shankerwangmiao@gmail.com>
Wed, 21 Jan 2026 17:30:17 +0000 (01:30 +0800)
committerMiao Wang <shankerwangmiao@gmail.com>
Mon, 4 May 2026 08:21:36 +0000 (16:21 +0800)
commit49df01ca70781851c941fdabfc997464b2c05fb0
tree8c0227dc89ddd88fc16b881d60dcd9651056dba0
parent671b95c4e1237d91bb829c6721f49674a159da50
[PATCH] Revert "QProcessEnvironment: simplify locking"

This reverts commit c5d6b263c204cb09db2be36826e19acb03dc24fb.

The commit being reverted assumes the mutex is only protecting 'nameMap'
and nothing else is mutable, which is false. The mutex is not only
protecting 'nameMap' but also protecting the containing value objects,
since even though the value object is accessed read-only, its
implementation mutates its internal states for 2-way conversion between
ByteArray and QString.

Commit 85e61297f7b02297641826332dbdbc845a88c34b ("restore
QProcessEnvironment shared data thread safety on unix") said that
implicit sharing together with 'mutable' is a time bomb and the bomb is
triggered by the reverted commit.

Fixes: QTBUG-142938
Pick-to: 6.11 6.10 6.8
Change-Id: I9e3234f0eb2c691eccf753a11f63fae9944bd503
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Gbp-Pq: Name upstream_revert_simplify_locking.diff
src/corelib/io/qprocess.cpp
src/corelib/io/qprocess_p.h
src/corelib/io/qprocess_unix.cpp